package com.atguigu.tingshu.order.enumeration;

import com.atguigu.tingshu.common.constant.SystemConstant;
import com.atguigu.tingshu.model.order.OrderInfo;

public enum OrderStatusEnum {
    ORDER_STATUS_UNPAID(SystemConstant.ORDER_STATUS_UNPAID, "待支付"),
    ORDER_STATUS_PAID(SystemConstant.ORDER_STATUS_PAID, "已支付"),
    ORDER_STATUS_CANCEL(SystemConstant.ORDER_STATUS_CANCEL, "已取消");

    private String orderStatus;
    private String orderStatusName;

    OrderStatusEnum(String orderStatus, String orderStatusName) {
        this.orderStatus = orderStatus;
        this.orderStatusName = orderStatusName;
    }
    public static String getOrderStatusEnum(String orderStatus) {
        OrderStatusEnum[] orderStatusEnums = OrderStatusEnum.values();
        for (OrderStatusEnum orderStatusEnum : orderStatusEnums) {
            if(orderStatusEnum.orderStatus.equals(orderStatus)){
                return orderStatusEnum.orderStatusName;
            }
        }
        return "";
    }

}
